Write a custom CUDA kernel to optimize `ARiA2` activation.

Formula: f(x) = x * (1 + exp(-beta * x))^(-alpha)

Problem Analysis:
1. Computation Bound: The formula involves `exp` and `pow`, which are expensive transcendental functions.
2. Memory Bandwidth: As an element-wise activation, it is also memory-bound. A PyTorch implementation `x * (1 + torch.exp(-beta * x)).pow(-alpha)` would launch multiple kernels and read/write intermediate tensors.

Optimization Strategy: Fused Element-wise Kernel with Vectorization

1. One-Pass: Fuse the entire computation into a single kernel pass. Load `x`, compute `result`, write `result`.

2. Vectorized Loads (float4): Use `float4` to load 128 bits per thread instruction.

3. Fast Math:
   - Compute `denom_inner = 1.0f + __expf(-beta * x)`.
   - Compute `factor = __powf(denom_inner, -alpha)`.
   - Result `x * factor`.
   Note: `__powf` and `__expf` are faster intrinsic versions.

4. Kernel Configuration: Launch a 1D grid to cover all elements.

Here's an example to show you the syntax of inline embedding custom CUDA operators in torch: The example given architecture is:   
  
```python
import torch
import torch.nn as nn

BATCH_SIZE = 4096
HIDDEN_DIM = 4096
SHAPE = (BATCH_SIZE, HIDDEN_DIM)

ALPHA_VAL = 1.5
BETA_VAL = 1.0

class ARiA2(nn.Module):
    """
    ARiA2 Activation: f(x) = x * (1 + e^(-beta*x))^(-alpha)
    ARiA: Utilizing Richard’s Curve for Controlling the Non-monotonicity of the Activation Function in Deep Neural Nets
    https://arxiv.org/pdf/1805.08878
    """
    def __init__(self, alpha=1.5, beta=1.0):
        super(ARiA2, self).__init__()
        self.alpha = alpha
        self.beta = beta

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return x * (1.0 + torch.exp(-self.beta * x)).pow(-self.alpha)

class Model(nn.Module):
    def __init__(self, alpha=1.5, beta=1.0):
        super(Model, self).__init__()
        self.act = ARiA2(alpha, beta)
    
    def forward(self, x):
        return self.act(x)

def get_inputs():
    input_tensor = torch.randn(SHAPE, dtype=torch.float32)
    return [input_tensor.contiguous()]

def get_init_inputs():
    return [ALPHA_VAL, BETA_VAL]